#include <stdarg.h>
#include "chain.h"
#include "menu.h"
#include "message.h"

void MessageParam(int index, char* format, ...) {
   va_list ap;
   va_start(ap, format);
   vsprintf(TmpStr,format,ap);
   va_end(ap);
   MessagePar(index,TmpStr);
}


void AnnularDOE(DoeType dt, double max, double min,
		double (*fun)(double) ) {
   chFun=chain(fun," ");
   DoeDoe= dt;
   FormDoe=dftAnnular;
   MaxValueDoe=max;
   MinValueDoe=min;
}

void CylindricalDOE(DoeType dt, double max, double min,
		double (*fun)(double) ) {
   chFun=chain(fun," ");
   DoeDoe= dt;
   FormDoe=dftCylindrical;
   MaxValueDoe=max;
   MinValueDoe=min;
}

void NonSymmetricDOE(DoeType dt, double max, double min,
		double (*fun)(double, double)) {
   chFun=chain(fun," ");
   DoeDoe= dt;
   FormDoe=dftNonSymmetric;
   MaxValueDoe=max;
   MinValueDoe=min;
}

void CrossedDOE(DoeType dt, double max, double min,
		double (*fun)(double, double),
		double (*fun1)(double), double (*fun2)(double)) {
   chFun=chain(fun," ");
   chFun1=chain(fun1," ");
   chFun2=chain(fun2," ");
   DoeDoe= dt;
   FormDoe=dftCrossed;
   MaxValueDoe=max;
   MinValueDoe=min;
}
